<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePrtAuthRuleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('prt_auth_rule', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('rule_pid')->default(0)->comment('父级id');
            $table->string('rule_name',50)->default("")->comment('菜单/操作名称');
            $table->string('rule_route',80)->default("")->comment('菜单路由');
            $table->string('rule_icon',200)->default("")->comment('菜单图标');
            $table->text('rule_remark')->comment('操作说明');
            $table->tinyInteger('is_menu')->default(1)->comment('是否为菜单,1为菜单,其他为权限节点');
            $table->integer('sort')->default(0)->comment('排序');
            $table->tinyInteger('status')->default(1)->comment('是否开启 1开启 0禁用');
            $table->string('modules')->default("")->comment('所属模块,可以是财务、运营、商品对应的标识');
            $table->integer('created_at')->comment("创建时间")->nullable();
            $table->integer('updated_at')->comment("更新时间")->nullable();
            $table->integer('deleted_at')->default(null)->comment("删除时间")->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('prt_auth_rule');
    }
}
